package com.swak.wechat.message;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import org.w3c.dom.Element;

import com.swak.utils.CDataAdapter;
import com.swak.utils.XmlParse;

/**
 * 企业微信客服消息接入
 * 
 * @author 618lf
 */
public class EventMsgCpkf extends AbstractEventMsg {

	private static final long serialVersionUID = 1L;

	private String token;
	private String openKfId;

	@XmlElement(name = "Token")
	@XmlJavaTypeAdapter(CDataAdapter.class)
	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	@XmlElement(name = "OpenKfId")
	@XmlJavaTypeAdapter(CDataAdapter.class)
	public String getOpenKfId() {
		return openKfId;
	}

	public void setOpenKfId(String openKfId) {
		this.openKfId = openKfId;
	}
	
    @Override
    public void read(Element element) {
        this.token = XmlParse.elementText(element, "Token");
        this.openKfId = XmlParse.elementText(element, "OpenKfId");
    }
}
